//
//  BCIndustryScreeningDisplayCell.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/11/19.
//  Copyright © 2018年 guoshikeji. All rights reserved.
//

#import "BCIndustryScreeningDisplayCell.h"

@interface BCIndustryScreeningDisplayCell ()

@property (nonatomic, strong) QMUILabel *contentLabel;

@end

@implementation BCIndustryScreeningDisplayCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.borderWidth = 0.5;
        self.layer.cornerRadius = 2.0;
        [self setupViews];
        //
        self.selected = false;
    }
    return self;
}

- (void)setupViews {
    self.contentLabel = [QMUILabel new];
    self.contentLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
//    self.contentLabel.textColor = [UIColor qmui_colorWithHexString:@"#666666"];
    self.contentLabel.adjustsFontSizeToFitWidth = true;
    self.contentLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self).insets(UIEdgeInsetsMake(4, 4, 4, 4));
    }];
}

//
- (void)setSelected:(BOOL)selected {
    [super setSelected:selected];
    //
    self.layer.borderColor = selected?[UIColor darkMainColor].CGColor:[UIColor separatorColor].CGColor;
    self.contentLabel.textColor = selected?[UIColor darkMainColor]:[UIColor qmui_colorWithHexString:@"#666666"];
}

- (void)setDisplayContent:(NSString *)displayContent {
    _displayContent = displayContent;
    self.contentLabel.text = displayContent;
}

@end
